<style type="text/css">
    .type1 {
        background-color: #fff !important;
    }
    
    .type2 {
        background-color: #ccc !important;
    }
</style>
<div>
    <table class="sui-table table-bordered">
        <thead>
            <tr>
                <th>#</th>
                <th>{{'item_image'|translate}}</th>
                <th>{{'item_id'|translate}}</th>
                <th>{{'title'|translate}}</th>
                <th>{{'price'|translate}}</th>
                <th>{{'operation'|translate}}</th>
            </tr>
        </thead>
        <tbody ng-repeat="item in itemslist1">
            <tr>
                <td>
                    <input style="display: none;" type="checkbox" name="checkids[]" id="item_{{item.item_id}}" ng-click="showInput(item.item_id,item)" value="{{item}}" checked="{{item.dazhe.item_checked=='item'?'checked':''}}" ng-disabled="{{item.dazhe.dazhe_type}}" class="numiidary ">
                </td>
                <td><img ng-src="{{item.img}}" width="60" /></td>
                <td>{{item.outer_id}}
                    <br> {{item.created_at | ddtt}}</td>
                <td>{{item.title}}</td>
                <td>
                    {{item.price}}
                    <br />
                    <input type="button" class="sui-btn btn-small btn-primary" id="item_{{item.item_id}}" ng-click="showInput(item.item_id,item)" value="{{item.dazhe.item_checked=='item'?'+':'-'}}" ng-disabled="item.dazhe.dazhe_type" class="numiidary {{item.skus.length==1?'zhide':''}}">
                </td>
                <td>
                    <!-- class="zhide" -->
                    <div id="opa_{{item.item_id}}" class="{{item.dazhe.item_checked=='item'?'':'zhide'}} {{item.dazhe.dazhe_type == 'item'?'zhide':''}}">
                        <div class="estop">
                            <input type="hidden" id="stype-{{item.item_id}}" value="1">
                            <span>    
                            <input id="np-{{item.item_id}}" type="text" value="{{(item.dazhe.type_id==1?(item.price*item.dazhe.discount/100):(item.price-item.dazhe.disprice)).toFixed(2)}}" class="input-np input-small">
                        </span>
                            <span> 打 <input id="dz-{{item.item_id}}" type="text" value="100" class="input-dz dzjq input-small" ng-class="item.dazhe.type_id==1?'type1':'type2'" ng-click="setType(item,1)" ng-model="item.dazhe.discount" ng-change="item.dazhe.disprice=(((100-item.dazhe.discount*1)/100*item.price).toFixed(2))" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/">折</span>
                            <span> 减    <input id="jq-{{item.item_id}}" type="text" value="0" class="input-jq dzjq input-small" style="display:initial;" ng-class="item.dazhe.type_id==2?'type1':'type2'" ng-click="setType(item,2)" ng-model="item.dazhe.disprice" ng-change="item.dazhe.discount=((1-item.dazhe.disprice/item.price)*100).toFixed(1)" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/">元</span>
                            <span>    
                            <button id="btn-{{item.item_id}}" type="button" class="sui-btn btn-primary" ng-click="addItemCuxiao(item,'item');">保存</button></span>
                        </div>
                    </div>
                    <div id="op1_{{item.item_id}}" class="{{item.dazhe.dazhe_type == 'item'?'':'zhide'}}">
                        <div class="estop">
                            <span>
                                折后价：[<span style="color:#FF0000;">{{(item.dazhe.type_id == 1?(item.price*item.dazhe.discount/100):(item.price - item.dazhe.disprice)).toFixed(2)}}</span>]
                            </span>
                            <span class="{{item.dazhe.type_id==1?'':'zhide'}}"> 
                                打 {{item.dazhe.discount}} 折
                            </span>
                            <span class="{{item.dazhe.type_id==2?'':'zhide'}}"> 
                                减 {{item.dazhe.disprice}} 元
                            </span>
                            <span>    
                                <button id="rtn-{{item.item_id}}" type="button" class="sui-btn btn-danger" ng-click="removeItemCuxiao(item,item.activity_id,item.dazhe.id,'item')">退出</button>
                            </span>
                        </div>
                    </div>
                </td>
            </tr>
            <!-- 新sku打折逻辑 -->
            <tr class="sku-{{item.item_id}} {{item.dazhe.item_checked == 'sku' || item.dazhe.item_checked == 'item'?'':'zhide'}}">
                <td colspan="7">
                    <table class="sui-table table-bordered {{item.skus.length==1?'zhide':''}}">
                        <tbody>
                            <tr ng-repeat="ab in item.newSkus" ng-show="$index == 0">
                                <th>ID</th>
                                <th ng-repeat="cc in ab.data">{{cc.name}}</th>
                                <th>{{'image'| translate}}</th>
                                <th style="width:20px">{{'operation'| translate}}</th>
                                <th class="{{item.dazhe.item_checked == 'item'?'zhide':''}}"></th>
                            </tr>
                            <tr ng-repeat="a in item.newSkus">
                                <!-- <td>{{a|json}}</td> -->
                                <!-- === {{item.skus.length}} -->
                                <td>{{a.id}}</td>
                                <td ng-repeat="(key, value) in a.data" rowspan="{{value.snum}}" class="{{value.snum?'':'zhide'}}">{{value.value}}</td>
                                <td>
                                    <ul class="unstyled">
                                        <li>
                                            <label><img ng-src="{{item.otherSkus[a.id].imgurl}}" style="width:100px;height: 100px"></label>
                                        </li>
                                    </ul>
                                </td>
                                <td style="width: 50%;">
                                    <!-- class="{{item.dazhe.dazhe_type == 'item'?'':'zhide'}}" -->
                                    <div id="opa_{{item.otherSkus[a.id].sku_id}}" class="{{item.dazhe.dazhe_type=='sku' || item.dazhe.item_checked=='item'?'zhide':''}}">
                                        <div class="estop">
                                            <input type="hidden" id="stype-{{item.otherSkus[a.id].sku_id}}" value="1">
                                            <span>  
                                                <!-- {{item.otherSkus[a.id].sku_price}}  -- {{item.otherSkus[a.id].dazhe|json}} -->
                                                <input id="np-{{item.otherSkus[a.id].sku_id}}" type="text" value="{{(item.otherSkus[a.id].dazhe.type_id==1?(item.otherSkus[a.id].sku_price*item.otherSkus[a.id].dazhe.discount/100):(item.otherSkus[a.id].sku_price - item.otherSkus[a.id].dazhe.disprice)).toFixed(2)}}" class="input-np input-small">
                                            </span>
                                            <span class="{{item.otherSkus[a.id].dazhe.type_id == 1?'':'zhide'}}"> 
                                                打 <input id="dz-{{item.otherSkus[a.id].sku_id}}" type="text" value="100" class="input-dz dzjq input-small" ng-class="item.otherSkus[a.id].dazhe.type_id==1?'type1':'type2'" ng-click="setSkuType(item,1,a.id)" ng-model="item.otherSkus[a.id].dazhe.discount" ng-change="item.otherSkus[a.id].dazhe.disprice=(((100-item.otherSkus[a.id].dazhe.discount*1) * item.otherSkus[a.id].sku_price)/100).toFixed(2)" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/">折</span>
                                            <span class="{{item.otherSkus[a.id].dazhe.type == 2?'':'zhide'}}"> 减 <input id="jq-{{item.otherSkus[a.id].sku_id}}" type="text" value="0" class="input-jq dzjq input-small" style="display:initial;" ng-class="item.otherSkus[a.id].dazhe.type_id==2?'type1':'type2'" ng-click="setSkuType(item,2,a.id)" ng-model="item.otherSkus[a.id].dazhe.disprice" ng-change="item.otherSkus[a.id].dazhe.discount=((1-item.otherSkus[a.id].dazhe.disprice/item.otherSkus[a.id].sku_price)*100).toFixed(1)" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/">元</span>
                                        </div>
                                    </div>
                                    <div id="opa_{{item.otherSkus[a.id].sku_id}}" class="{{item.dazhe.dazhe_type=='sku'?'':'zhide'}}">
                                        <div class="estop">
                                            <span>
                                                折后价：[<span style="color: #FF0000;">{{(item.otherSkus[a.id].dazhe.type_id==1?(item.otherSkus[a.id].sku_price*item.otherSkus[a.id].dazhe.discount/100):(item.otherSkus[a.id].sku_price - item.otherSkus[a.id].dazhe.disprice)).toFixed(2)}}</span>]
                                            </span>
                                            <span class="{{item.otherSkus[a.id].dazhe.type_id==1?'':'zhide'}}"> 打 {{item.otherSkus[a.id].dazhe.discount}} 折</span>
                                            <span class="{{item.otherSkus[a.id].dazhe.type_id==2?'':'zhide'}}"> 减 {{item.otherSkus[a.id].dazhe.disprice}} 元</span>
                                        </div>
                                    </div>
                                    <div id="opsku_{{item.otherSkus[a.id].sku_id}}" class="{{item.dazhe.item_checked=='item'?'':'zhide'}}">
                                        <div class="estop">
                                            <span>
                                                折后价：[<span style="color:#FF0000;">{{(item.dazhe.type_id == 1?(item.otherSkus[a.id].sku_price*item.dazhe.discount/100):(item.otherSkus[a.id].sku_price - item.dazhe.disprice)).toFixed(2)}}</span>]
                                            </span>
                                        </div>
                                    </div>
                                </td>
                                <td rowspan="{{item.skus.length}}" ng-if="$index==0">
                                    <span class="{{item.dazhe.dazhe_type=='sku' || item.dazhe.item_checked=='item'?'zhide':''}}">
                                       <button id="sku-{{item.item_id}}" class="sui-btn btn-primary {{sku_data.dazhe.sku_checked?'zhide':''}}" ng-click="addItemCuxiao(item,'sku');"> 保存 </button> 
                                    </span>
                                    <span class="{{item.dazhe.dazhe_type=='sku'?'':'zhide'}}">
                                        <button class="sui-btn btn-danger" ng-click="removeItemCuxiao(item,item.activity_id,item.otherSkus[a.id].dazhe.id,'sku');"> 退出 </button>
                                    </span>
                                </td>
                                <td style="display: none;" class="{{item.dazhe.dazhe_type=='sku'?'':'zhide'}}">
                                    <span class="{{item.dazhe.dazhe_type=='sku'?'':'zhide'}}">
                                        <button class="sui-btn btn-danger" ng-click="removeItemCuxiao(item,item.activity_id,item.otherSkus[a.id].dazhe.id,'sku');"> 退出 </button>
                                    </span>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
            <!-- </table> -->
        </tbody>
    </table>
    <!-- 分页start -->
    <pager page-no="1" page-size="pageSize" total="itemsTotal" get-data="pageData(pageNo)"></pager>
    <!-- 分页end -->
</div>